Skip to content

fix(cli): the CLI orders names the same way on every machine - #11683

Merged
josephfarina merged 6 commits into
mainfrom
josephfarina/compare-text
Nov 14, 2026
Merged

josephfarina merged 6 commits into
mainfrom
josephfarina/compare-text

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What changes

The CLI sorted and broke ties with String.prototype.localeCompare() and no locale, so its order followed the host's language setting on Node builds with full locale data (the official builds, macOS). Under some locales this changed which page template build starts from, and the order of block, component and other lists.

  • New compareText (foundation/text/compare-text.mjs): one fixed order that never reads a locale. It compares case-folded text character by character by Unicode class (spaces, then punctuation, then symbols, then digits, then letters), then by code point; a case-only tie puts lowercase first. For the names the CLI sorts, this is the order an English host gave.
  • 70 calls in 41 files across build, search, discovery, the CLI commands (including astryx component --list), the manifest, doctor, upgrade, integration, theme and docs adapters now use it. Two calls keep a fixed 'en' locale for numeric version order.
  • An ESLint rule on all of packages/cli (tests excepted) flags localeCompare and Intl.Collator without a fixed locale.
  • AST-048 FR7 and AST-083 FR5 each gain one line: tied names order the same way on every host.
  • The AST-083 FR5 verification row and the AST-048 FR6, FR7 verification row name the new host-locale tests (component.host-locale.test.mjs and the host-locale checks in build.test.mjs). Prettier realigned those tables, so their diffs are wider than the edit.

Measured

On an English host (Node with full locale data), output is unchanged: 3,933 CLI commands (lists, not-found suggestions for 610 catalog words, search, build) give byte-identical output with the old and new comparison; every one of the 43,958 comparisons those commands make agrees in sign; all pairs of the 1,964 shipped names agree; 6,810 repository paths sort identically. Build's starts, alternatives and blocks are also unchanged on the whole replay set. Within one character class, characters sort by code point, so - sorts before _ where the root collation puts _ first; no shipped name or path depends on that. Under Turkish, Lithuanian, Czech and Hawaiian locales the output now equals the English output (before, one locale changed 82 starts and about 2,500 block lists).

Tests

  • compareText order; ranking is the same for a reversed or rotated catalog; exact ties break by name.
  • component --list under en_US vs cs_CZ and haw_US (fails without the change).
  • Build gives the same answers twice and under cs_CZ, haw_US and tr_TR, compared with en_US (fails without the change: "data table" moves its start under haw_US). Both locale tests skip on a Node without full locale data.

Writing rubric results

  • R1 narration: none; both added sentences state present behavior.
  • R2 research: none in the records; the locale measurements stay in this PR.
  • R3 evidence: the AST-083 FR5 and AST-048 FR6, FR7 verification rows now name the host-locale tests that check them; no evidence cell changed otherwise.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none touched.
  • R7 project status: none.

@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 14, 2026 1:04pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 14, 2026
@astracat-bot

astracat-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 14, 2026, 1:14 PM UTC

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · b7f634a

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 4.37 MB packed (+2.1 kB); no new dependencies.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.

Current run: CI concluded failure; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are needed, and approval also waits on an engineering owner's decision.

Owner decision: no current spec says that build's start-template tie-break (spec:AST-048 FR1, FR7) or the CLI's discovery lists must order tied names the same way on every host, since spec:AST-083 FR5 covers only search, build-block and suggestion order; an engineering owner (the author included) records the decision by commenting /approve-spec <full head SHA> on this pull request, or by naming the record that states it.

Blocking:

  • The title and .changeset/compare-text.md say the whole CLI now orders names the same way on every machine, but astryx component --list still sorts by host locale (packages/cli/clients/cli/commands/component.mjs:399, where under cs_CZ the Chat* and Checkbox* entries print after HStack), so narrow the wording to build, search and discovery, or move that sort to compareText.
  • The description says 45 localeCompare() calls were replaced, but the diff replaces 44 calls in 24 files, so correct the count.

Non-blocking: the new locale tests also pass without this change, so an input that differs today (such as astryx search "contact form" under cs_CZ) would let them catch a regression, and the lint selector misses localeCompare(x, undefined) and new Intl.Collator().

Claims and files checked
  • Claim: build, search and discovery broke ties with the host locale. Verified: 44 call sites on the base.
  • Claim: the order followed the host language on full-ICU Node. Verified: search order differs under Czech, Lithuanian and Turkish on the base.
  • Claim: some locales changed build's start template and block lists. Not reproduced on 98 build requests; the search order differences did reproduce.
  • Claim: compareText gives one fixed order. Verified in compare-text.mjs and its tests.
  • Claim: all 45 calls now use it. All are replaced, but the count is 44 (false).
  • Claim: a lint rule bans localeCompare without a locale in those folders. Verified for one-argument calls only.
  • Claim: English-host answers are unchanged. Verified: 98 build requests and 136 searches give identical answers.
  • Claim: Turkish, Lithuanian and Czech output equals English. Verified on the same requests.
  • Claim: earlier counts of changed starts and block lists on a replay set. Not reproducible here.
  • Claim: tests cover order, catalog rotation, exact ties and locale runs. They pass; the tie and locale tests also pass without the change.
  • Changeset: the whole CLI orders names the same way on every machine. False (component --list).
  • Changeset: the lint rule keeps locale-dependent comparisons out of those folders. Partly true: it catches one-argument calls only.
  • File .changeset/compare-text.md: blocking finding (scope).
  • File packages/cli/foundation/text/compare-text.mjs: its header overstates the scope (same finding); the code is clear.
  • File eslint.config.js: clear; selector gap noted.
  • Files packages/cli/api/build/build.test.mjs and packages/cli/api/build/kit/rank.test.mjs: the new tests pass on the base (non-blocking).
  • File packages/cli/api/build/kit/rank.mjs: clear; waits on the owner decision.
  • The other 28 files (comparator swaps and their tests under api/search, foundation/discovery, foundation/doc-compiler, foundation/env, foundation/fs, foundation/integrations, foundation/render, foundation/text and foundation/xle): clear.

Automated review (maintainer link)

Comment thread .changeset/compare-text.md Resolved
Comment thread eslint.config.js Resolved
Comment thread packages/cli/api/build/build.test.mjs Resolved
@josephfarina josephfarina changed the title fix(cli): order names the same way on every machine fix(cli): the CLI orders names the same way on every machine Nov 14, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b2fda08

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@josephfarina
josephfarina marked this pull request as draft November 14, 2026 06:07
@josephfarina
josephfarina marked this pull request as ready for review November 14, 2026 06:11

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the unit test, typecheck and build jobs have not finished on this head yet.

compareText now orders every CLI list and tie-break the same way on every host, and the new lines in spec:AST-048 FR7 and spec:AST-083 FR5 carry an engineering owner's approval for this head. The earlier points are addressed: astryx component --list uses the fixed order, the description's call count matches the diff, and the new locale tests fail without the change.

Non-blocking:

  • AST-083's new FR5 line covers "a result or a list", but the record's Intent still names only search, build blocks and not-found suggestions, and neither the AST-083 FR5 nor the AST-048 FR6/FR7 verification row names the new host-locale tests; consider adding api/build/build.test.mjs and clients/cli/commands/component.host-locale.test.mjs to those rows and naming the CLI's other lists in the record.
Claims and files checked
  • Claim: the CLI sorted and broke ties with the host's locale. Verified: 70 one-argument localeCompare calls on the base.
  • Claim: on Node with full locale data the order followed the host language. Verified: search, build and component --list differ under Czech, Hawaiian, Lithuanian and Turkish on the base.
  • Claim: some locales changed build's start template and list order. Verified: under Hawaiian, 3 of 108 requests start from another template on the base, including "data table".
  • Claim: compareText gives one fixed order, case-folded then lowercase first. Verified in the helper and its tests.
  • Claim: 70 calls in 41 files now use it. Verified against the diff.
  • Claim: two calls keep a fixed 'en' locale for numeric version order. Verified.
  • Claim: a lint rule on the CLI's code, tests excepted, flags localeCompare and Intl.Collator without a fixed locale. Verified for every linted CLI source file; the page templates the CLI scaffolds keep their locale-aware sorts.
  • Claim: AST-048 FR7 and AST-083 FR5 each gain one line. Verified.
  • Claim: on an English host, build's starts, alternatives and blocks are unchanged. Verified on 108 requests; search results and component --list are unchanged too.
  • Claim: Turkish, Lithuanian, Czech and Hawaiian output now equals English. Verified on the same requests.
  • Claim: earlier counts of 82 changed starts and about 2,500 block lists on a replay set. Not reproducible here: the replay set is not in the repository.
  • Claim: tests cover the helper's order, catalog order, exact ties, and locale runs that fail without the change. Verified: both locale tests fail on the base and pass on the head.
  • Changeset: the CLI orders names the same way on every machine, another language could pick a different template or list order, and a lint rule keeps locale-dependent comparisons out of the CLI. Verified.
  • Files docs/specs/AST-048-build-recommendation/spec.md, docs/specs/AST-083-result-order/spec.md: clear; non-blocking note on the FR5 line's scope and the verification rows.
  • File .changeset/compare-text.md: clear.
  • Files packages/cli/foundation/text/compare-text.mjs and its test: clear.
  • File eslint.config.js: clear; the later rule overrides keep the new selectors.
  • Files packages/cli/api/build/build.test.mjs, packages/cli/clients/cli/commands/component.host-locale.test.mjs: clear; both fail without the change.
  • Files packages/cli/api/build/kit/rank.mjs, packages/cli/api/build/kit/rank.test.mjs: clear.
  • The other 45 files (comparator swaps and their test updates under api, assets/codemods, clients/cli and foundation): clear.

Automated review (maintainer link)

Comment on lines +78 to +79
Tied names order the same way on every host: the host's language setting
never changes the order of a result or a list.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this line covers "a result or a list", but this record's Intent still names only astryx search, build's blocks and the not-found suggestions, so the rule behind astryx component --list, doctor, upgrade and manifest order is hard to find here. The FR5 verification row also still lists only the offline and repeat checks. Consider adding api/build/build.test.mjs ("gives the same answers under every host locale") and clients/cli/commands/component.host-locale.test.mjs to that row (and the AST-048 FR6, FR7 row), and naming the CLI's other lists in the Intent or in architecture:cli-surface.

@josephfarina
josephfarina enabled auto-merge (squash) November 14, 2026 06:20
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 4417ac4

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: one blocking finding.

  • Miss: compareText sorts the em dash — after every letter, so the template catalog sort (packages/cli/foundation/discovery/template-adapter.mjs:1622) reorders 51 of the 79 astryx template <name> not-found suggestion lists probed on an English host (astryx template card moves library from 7th to 2nd) without the failed-lookup measurement AST-083 FR7 requires; keep the earlier order for names with — and _, or report that measurement, and correct the helper header that calls this the en-US order.

The same change moves 8 entries in astryx template --list and splits component groups ("List Item — Basic" now sits between "List" and "List — Basic"). Everything else checks out: both new locale tests fail on the base and pass on this head, and English-host build, search and component lists are unchanged. Non-blocking: consider naming the new locale tests in the AST-083 and AST-048 verification rows.

Claims and files checked
  • The CLI broke ties with a locale-less localeCompare, so on full-ICU Node the order followed the host's language, changing build's start under some locales: verified (the new build test fails on the base under haw_US, where data table starts from shell-top-nav).
  • A new compareText gives one fixed order, case-folded code units then lowercase first: verified (compare-text.mjs:27-29 and its test).
  • 70 calls in 41 files now use it: verified (70 one-argument calls removed across 41 non-test files; none remain in CLI .mjs source).
  • Two calls keep a fixed 'en' locale for numeric version order: verified (api/discover/_adapter.mjs:493, authoring/discover/parse.mjs:77).
  • A lint rule on the CLI, tests excepted, flags localeCompare and Intl.Collator without a fixed locale: verified for every CLI .mjs file (eslint.config.js:848-852, plus the three later command blocks); the .tsx page templates are example code outside the glob.
  • AST-048 FR7 and AST-083 FR5 each gain one line: verified.
  • On an English host, build's starts, alternatives and blocks are unchanged: verified for 40 requests; the replay set itself is not in the repository.
  • Under Turkish, Lithuanian, Czech and Hawaiian locales the output equals the English output: verified for search, build, component --list and template --list.
  • Before, one locale changed 82 starts and about 2,500 block lists: not checkable here (the replay set is not in the repository); under haw_US 3 of 40 starts move on the base.
  • Tests cover compareText's order, catalog-order independence and exact ties: verified (pass on the head).
  • The component --list locale test fails without the change: verified (fails on the base under cs_CZ).
  • The build locale test fails without the change: verified (fails on the base under haw_US).
  • Both locale tests skip on a Node without full locale data: verified (skipIf guards).
  • Release note: the CLI orders names the same way on every machine and a lint rule keeps locale-dependent comparisons out of the CLI: verified for CLI .mjs source.
  • .changeset/compare-text.md: clear
  • docs/specs/AST-048-build-recommendation/spec.md: clear
  • docs/specs/AST-083-result-order/spec.md: non-blocking note (Intent and verification row)
  • eslint.config.js: clear
  • packages/cli/api/build/build.test.mjs: clear
  • packages/cli/api/build/kit/rank.mjs: clear
  • packages/cli/api/build/kit/rank.test.mjs: clear
  • packages/cli/api/component/list/list.mjs: clear
  • packages/cli/api/discover/search/search.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: clear
  • packages/cli/api/doctor/_adapter.mjs: clear
  • packages/cli/api/doctor/built-checks.mjs: clear
  • packages/cli/api/icon/_records.mjs: clear
  • packages/cli/api/integration/authoring-checks.mjs: clear
  • packages/cli/api/integration/validate-integration.mjs: clear
  • packages/cli/api/search/_lexical.mjs: clear
  • packages/cli/api/theme-edit/_preview-app.mjs: clear
  • packages/cli/api/theme-edit/_preview.mjs: clear
  • packages/cli/api/theme-edit/_settings.mjs: clear
  • packages/cli/api/theme/_adapter.mjs: clear
  • packages/cli/api/upgrade/run/run.mjs: clear
  • packages/cli/assets/codemods/integration-discovery.mjs: clear
  • packages/cli/clients/cli/commands/component.host-locale.test.mjs: clear
  • packages/cli/clients/cli/commands/component.mjs: clear
  • packages/cli/clients/cli/commands/doctor-integration.test.mjs: clear
  • packages/cli/clients/cli/lib/cli-error.mjs: clear
  • packages/cli/clients/cli/lib/manifest.mjs: clear
  • packages/cli/clients/cli/lib/manifest.test.mjs: clear
  • packages/cli/foundation/discovery/component-discovery.mjs: clear
  • packages/cli/foundation/discovery/component-discovery.test.mjs: clear
  • packages/cli/foundation/discovery/copied-passages.mjs: clear
  • packages/cli/foundation/discovery/doc-types.mjs: clear
  • packages/cli/foundation/discovery/hook-discovery.mjs: clear
  • packages/cli/foundation/discovery/hook-discovery.test.mjs: clear
  • packages/cli/foundation/discovery/icon-definition-discovery.mjs: clear
  • packages/cli/foundation/discovery/icon-set-checks.mjs: clear
  • packages/cli/foundation/discovery/icon-set-discovery.mjs: clear
  • packages/cli/foundation/discovery/integration-doc-files.mjs: clear
  • packages/cli/foundation/discovery/prop-drift.mjs: clear
  • packages/cli/foundation/discovery/template-adapter.mjs: blocking finding (template order, AST-083 FR7)
  • packages/cli/foundation/discovery/template-icons.mjs: clear
  • packages/cli/foundation/discovery/theme-discovery.mjs: clear
  • packages/cli/foundation/discovery/theming-targets.mjs: clear
  • packages/cli/foundation/discovery/theming-targets.test.mjs: clear
  • packages/cli/foundation/doc-compiler/inputs.mjs: clear
  • packages/cli/foundation/env/semver.mjs: clear
  • packages/cli/foundation/fs/file-protection.mjs: clear
  • packages/cli/foundation/integrations/contribution-inventory.mjs: clear
  • packages/cli/foundation/integrations/public-imports.mjs: clear
  • packages/cli/foundation/render/rebuild.mjs: clear
  • packages/cli/foundation/text/compare-text.mjs: finding (header misstates the order)
  • packages/cli/foundation/text/compare-text.test.mjs: clear
  • packages/cli/foundation/text/string-utils.mjs: clear
  • packages/cli/foundation/text/string-utils.test.mjs: clear
  • packages/cli/foundation/text/suggest-order.mjs: clear
  • packages/cli/foundation/xle/expand.mjs: clear

Automated review (maintainer link)

… classes, so English-host lists keep their order
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec a11a51e

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: one blocking finding, and it is in the pull request description only.

  • The "Writing rubric results" line R3 says no evidence or verification cell changed, but this head changes the AST-083 FR5 verification row and the AST-048 FR6, FR7 row to name the new host-locale tests; update R3, and list those rows under "What changes".

The em-dash reordering from the last review is fixed: on an English host, template --list and every template, component and docs lookup checked print what they printed before, and Czech, Hawaiian, Turkish and Lithuanian hosts now print the same. Non-blocking: the compare-text.mjs header could say "the names the CLI ships", since user-supplied names with _ or accented letters sort by code point (the doctor test already shows .drafts/ before __fixtures__/).

Claims and files checked
  • The CLI broke ties with a locale-less comparison, so on Node with full locale data its order followed the host's language: verified (Czech and Hawaiian hosts reorder lists and search on the merge base).
  • Under some locales this changed build's start template and the order of block, component and other lists: verified (under Hawaiian, data table, table and table page get other starts on the merge base).
  • The new comparator case-folds, orders by character class, then by code point, with lowercase first on a case-only tie: verified (compare-text.mjs:23, :53-67, and its tests).
  • For the names the CLI sorts, this is the English-host order: verified for shipped names (the catalog test passes on this head and on it merged into main); user-supplied names differ where the description says they can.
  • 70 calls in 41 files now use it: verified (70 one-argument calls replaced in 41 non-test files).
  • Two calls keep a fixed 'en' locale for numeric version order: verified (api/discover/_adapter.mjs:493, authoring/discover/parse.mjs:77).
  • A lint rule on the CLI, tests excepted, flags locale-less localeCompare and Intl.Collator: verified for every CLI .mjs file; the .tsx page templates are example code outside it.
  • Each record gains one host-independence line: verified, but the verification rows also change (blocking finding).
  • English-host output is unchanged: verified for 330 lookups and 8 list outputs; the replay counts themselves are not in the repository.
  • Build's starts, alternatives and blocks are unchanged on an English host: verified for 40 requests.
  • Code-point order inside a class affects no shipped name or path: verified for the shipped catalogs and the CLI's own paths.
  • Turkish, Lithuanian, Czech and Hawaiian hosts now print the English output: verified for every probe; the earlier 82-start count is not checkable here.
  • The tests cover the comparator, catalog-order independence and exact ties: verified (pass).
  • The component --list and build locale tests fail without the change and skip without full locale data: verified (both fail on the merge base; skipIf guards).
  • Rubric results: no narration, research, rejected alternatives, change references, open questions or project status in the records: verified.
  • Rubric result R3, no evidence or verification cell changed: false (blocking finding).
  • Release note: one fixed order for build, search, discovery and the lists, kept by a lint rule: verified for CLI .mjs source.
  • .changeset/compare-text.md: clear
  • docs/specs/AST-048-build-recommendation/spec.md: blocking finding (description R3)
  • docs/specs/AST-083-result-order/spec.md: blocking finding (description R3)
  • eslint.config.js: clear
  • packages/cli/api/build/build.test.mjs: clear
  • packages/cli/api/build/kit/rank.mjs: clear
  • packages/cli/api/build/kit/rank.test.mjs: clear
  • packages/cli/api/component/list/list.mjs: clear
  • packages/cli/api/discover/search/search.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: clear
  • packages/cli/api/doctor/_adapter.mjs: clear
  • packages/cli/api/doctor/built-checks.mjs: clear
  • packages/cli/api/icon/_records.mjs: clear
  • packages/cli/api/integration/authoring-checks.mjs: clear
  • packages/cli/api/integration/validate-integration.mjs: clear
  • packages/cli/api/search/_lexical.mjs: clear
  • packages/cli/api/theme-edit/_preview-app.mjs: clear
  • packages/cli/api/theme-edit/_preview.mjs: clear
  • packages/cli/api/theme-edit/_settings.mjs: clear
  • packages/cli/api/theme/_adapter.mjs: clear
  • packages/cli/api/upgrade/run/run.mjs: clear
  • packages/cli/assets/codemods/integration-discovery.mjs: clear
  • packages/cli/clients/cli/commands/component.host-locale.test.mjs: clear
  • packages/cli/clients/cli/commands/component.mjs: clear
  • packages/cli/clients/cli/commands/doctor-integration.test.mjs: clear
  • packages/cli/clients/cli/lib/cli-error.mjs: clear
  • packages/cli/clients/cli/lib/manifest.mjs: clear
  • packages/cli/clients/cli/lib/manifest.test.mjs: clear
  • packages/cli/foundation/discovery/component-discovery.mjs: clear
  • packages/cli/foundation/discovery/component-discovery.test.mjs: clear
  • packages/cli/foundation/discovery/copied-passages.mjs: clear
  • packages/cli/foundation/discovery/doc-types.mjs: clear
  • packages/cli/foundation/discovery/hook-discovery.mjs: clear
  • packages/cli/foundation/discovery/hook-discovery.test.mjs: clear
  • packages/cli/foundation/discovery/icon-definition-discovery.mjs: clear
  • packages/cli/foundation/discovery/icon-set-checks.mjs: clear
  • packages/cli/foundation/discovery/icon-set-discovery.mjs: clear
  • packages/cli/foundation/discovery/integration-doc-files.mjs: clear
  • packages/cli/foundation/discovery/prop-drift.mjs: clear
  • packages/cli/foundation/discovery/template-adapter.mjs: clear
  • packages/cli/foundation/discovery/template-icons.mjs: clear
  • packages/cli/foundation/discovery/theme-discovery.mjs: clear
  • packages/cli/foundation/discovery/theming-targets.mjs: clear
  • packages/cli/foundation/discovery/theming-targets.test.mjs: clear
  • packages/cli/foundation/doc-compiler/inputs.mjs: clear
  • packages/cli/foundation/env/semver.mjs: clear
  • packages/cli/foundation/fs/file-protection.mjs: clear
  • packages/cli/foundation/integrations/contribution-inventory.mjs: clear
  • packages/cli/foundation/integrations/public-imports.mjs: clear
  • packages/cli/foundation/render/rebuild.mjs: clear
  • packages/cli/foundation/text/compare-text.mjs: non-blocking note (header wording)
  • packages/cli/foundation/text/compare-text.test.mjs: clear
  • packages/cli/foundation/text/string-utils.mjs: clear
  • packages/cli/foundation/text/string-utils.test.mjs: clear
  • packages/cli/foundation/text/suggest-order.mjs: clear
  • packages/cli/foundation/xle/expand.mjs: clear

Automated review (maintainer link)

Comment thread docs/specs/AST-083-result-order/spec.md Resolved
Comment on lines +13 to +14
* so it is the same on every machine. For the names the CLI sorts it
* matches the order an English host gives. Pure, so browser-bundled code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: "For the names the CLI sorts it matches the order an English host gives" holds for the shipped catalogs, but inside a class this sorts by code point, so user-supplied names differ: components/.drafts/… now sorts before components/__fixtures__/… (the doctor test at doctor-integration.test.mjs:512), and Éclair after Zebra. "For the names the CLI ships" would match the description.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b7f634a

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: lint and the CLI smoke test pass on this head, but the main CI run stopped at admission because CI was full, so its build, typecheck and test jobs have not run yet; re-running all jobs is the next step.

The blocking finding from the last review is fixed: the description's rubric result now names the two verification-row edits. On this head, build, search, the list commands and not-found suggestions print the same output under Czech, Hawaiian, Turkish and Lithuanian hosts as under English, and English-host output for shipped names is unchanged. Three non-blocking notes stay from the last review: the helper header's English-order wording, the result-order record's Intent, and the second compareText (code-unit order) in api/theme/build/family.mjs.

Claims and files checked
  • The CLI's locale-less comparisons made its order follow the host's language on Node with full locale data: verified (Czech, Hawaiian and Lithuanian hosts reorder lists and search on the base).
  • Under some locales this changed build's start template and the order of block, component and other lists: verified (under Hawaiian, data table, table and table page get other starts on the base).
  • The new comparator case-folds, orders by character class, then by code point, with lowercase first on a case-only tie: verified (compare-text.mjs:23, :53-67, its tests, and a fuzzed total-order check).
  • For the names the CLI sorts, this is the English-host order: verified for shipped names (every pair of 1,895 listed names agrees with an English collator, and 7,367 package paths sort the same); user-supplied names differ where the description says they can.
  • 70 calls in 41 files now use it: verified.
  • Two calls keep a fixed 'en' locale for numeric version order: verified (api/discover/_adapter.mjs:493, authoring/discover/parse.mjs:77).
  • A lint rule on the CLI, tests excepted, flags locale-less localeCompare and Intl.Collator: verified for every non-test CLI .mjs file; the .tsx page templates are example code outside it.
  • Each of the two records gains one host-independence line, and the two verification rows name the new locale tests: verified.
  • English-host output is unchanged: verified for 23 list, search, build and not-found outputs and seven theme builds; the replay counts themselves are not in the repository.
  • Build's starts, alternatives and blocks are unchanged on an English host: verified for the builds probed.
  • Code-point order inside a class affects no shipped name or path: verified.
  • Turkish, Lithuanian, Czech and Hawaiian hosts now print the English output: verified for every probe; the earlier start and block-list counts are not checkable here.
  • The tests cover the comparator, catalog-order independence and exact ties: verified (pass).
  • The component --list and build locale tests fail without the change and skip without full locale data: verified (both fail on the base; skipIf guards).
  • Rubric results: no narration, research, rejected alternatives, change references, open questions or project status; only the two verification rows changed among evidence cells: verified.
  • Release note: build, search, discovery and the lists use one fixed order, kept by a lint rule: verified for CLI .mjs source.
  • .changeset/compare-text.md: clear
  • docs/specs/AST-048-build-recommendation/spec.md: clear
  • docs/specs/AST-083-result-order/spec.md: non-blocking note (Intent)
  • eslint.config.js: clear
  • packages/cli/api/build/build.test.mjs: clear
  • packages/cli/api/build/kit/rank.mjs: clear
  • packages/cli/api/build/kit/rank.test.mjs: clear
  • packages/cli/api/component/list/list.mjs: clear
  • packages/cli/api/discover/search/search.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: clear
  • packages/cli/api/doctor/_adapter.mjs: clear
  • packages/cli/api/doctor/built-checks.mjs: clear
  • packages/cli/api/icon/_records.mjs: clear
  • packages/cli/api/integration/authoring-checks.mjs: clear
  • packages/cli/api/integration/validate-integration.mjs: clear
  • packages/cli/api/search/_lexical.mjs: clear
  • packages/cli/api/theme-edit/_preview-app.mjs: clear
  • packages/cli/api/theme-edit/_preview.mjs: clear
  • packages/cli/api/theme-edit/_settings.mjs: clear
  • packages/cli/api/theme/_adapter.mjs: clear
  • packages/cli/api/upgrade/run/run.mjs: clear
  • packages/cli/assets/codemods/integration-discovery.mjs: clear
  • packages/cli/clients/cli/commands/component.host-locale.test.mjs: clear
  • packages/cli/clients/cli/commands/component.mjs: clear
  • packages/cli/clients/cli/commands/doctor-integration.test.mjs: clear
  • packages/cli/clients/cli/lib/cli-error.mjs: clear
  • packages/cli/clients/cli/lib/manifest.mjs: clear
  • packages/cli/clients/cli/lib/manifest.test.mjs: clear
  • packages/cli/foundation/discovery/component-discovery.mjs: clear
  • packages/cli/foundation/discovery/component-discovery.test.mjs: clear
  • packages/cli/foundation/discovery/copied-passages.mjs: clear
  • packages/cli/foundation/discovery/doc-types.mjs: clear
  • packages/cli/foundation/discovery/hook-discovery.mjs: clear
  • packages/cli/foundation/discovery/hook-discovery.test.mjs: clear
  • packages/cli/foundation/discovery/icon-definition-discovery.mjs: clear
  • packages/cli/foundation/discovery/icon-set-checks.mjs: clear
  • packages/cli/foundation/discovery/icon-set-discovery.mjs: clear
  • packages/cli/foundation/discovery/integration-doc-files.mjs: clear
  • packages/cli/foundation/discovery/prop-drift.mjs: clear
  • packages/cli/foundation/discovery/template-adapter.mjs: clear
  • packages/cli/foundation/discovery/template-icons.mjs: clear
  • packages/cli/foundation/discovery/theme-discovery.mjs: clear
  • packages/cli/foundation/discovery/theming-targets.mjs: clear
  • packages/cli/foundation/discovery/theming-targets.test.mjs: clear
  • packages/cli/foundation/doc-compiler/inputs.mjs: clear
  • packages/cli/foundation/env/semver.mjs: clear
  • packages/cli/foundation/fs/file-protection.mjs: clear
  • packages/cli/foundation/integrations/contribution-inventory.mjs: clear
  • packages/cli/foundation/integrations/public-imports.mjs: clear
  • packages/cli/foundation/render/rebuild.mjs: clear
  • packages/cli/foundation/text/compare-text.mjs: non-blocking note (header wording)
  • packages/cli/foundation/text/compare-text.test.mjs: clear
  • packages/cli/foundation/text/string-utils.mjs: clear
  • packages/cli/foundation/text/string-utils.test.mjs: clear
  • packages/cli/foundation/text/suggest-order.mjs: clear
  • packages/cli/foundation/xle/expand.mjs: clear

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec c946b35

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: lint, typecheck, the CLI smoke test and codemod checks pass on this head, but the main CI run's node, UI, build, docsite and swizzle-proof jobs are still running.

The merge of main keeps the change whole: Core's component list, now also stored at publish, goes through the same fixed order as the live read, so the stored and live lists print alike on every host. On this head, build, search, the list commands and not-found suggestions print the same output under Czech, Hawaiian, Turkish and Lithuanian hosts as under English, and English-host output is unchanged from the base. Four non-blocking notes remain: the merged-in Czech case in packages/cli/test/packed-component-list.test.mjs is still titled "prints groups in the running locale's order", the helper header's English-order wording, the result-order record's Intent, and the second compareText (code-unit order) in api/theme/build/family.mjs.

Claims and files checked
  • The CLI's locale-less comparisons made its order follow the host's language on Node with full locale data: verified (Czech, Hawaiian and Lithuanian hosts reorder lists and search on the base).
  • Under some locales this changed build's start template and the order of block, component and other lists: verified (under Hawaiian, build table starts from the app shell on the base).
  • The new comparator case-folds, orders by character class, then by code point, with lowercase first on a case-only tie: verified (compare-text.mjs:23, :53-67, its tests, and a fuzzed total-order check).
  • For the names the CLI sorts, this is the English-host order: verified for every sorted shipped name and 6,620 package paths; user-supplied names differ where the description says they can.
  • 70 calls in 41 files now use it: verified.
  • Two calls keep a fixed 'en' locale for numeric version order: verified (api/discover/_adapter.mjs:493, authoring/discover/parse.mjs:77).
  • A lint rule on the CLI, tests excepted, flags locale-less localeCompare and Intl.Collator: verified for all 730 linted non-test CLI .mjs files; the .tsx page templates are example code outside it.
  • Each of the two records gains one host-independence line, and the two verification rows name the new locale tests: verified.
  • English-host output is unchanged: verified for 24 list, search, build and not-found outputs; the replay counts themselves are not in the repository.
  • Build's starts, alternatives and blocks are unchanged on an English host: verified for the builds probed.
  • Code-point order inside a class affects no shipped name or path: verified.
  • Turkish, Lithuanian, Czech and Hawaiian hosts now print the English output: verified for every probe; the earlier start and block-list counts are not checkable here.
  • The tests cover the comparator, catalog-order independence and exact ties: verified (pass).
  • The component --list and build locale tests fail without the change and skip without full locale data: verified (both fail on the base; skipIf guards).
  • Rubric results: no narration, research, rejected alternatives, change references, open questions or project status; only the two verification rows changed among evidence cells: verified.
  • Release note: build, search, discovery and the lists use one fixed order, kept by a lint rule: verified for CLI .mjs source.
  • .changeset/compare-text.md: clear
  • docs/specs/AST-048-build-recommendation/spec.md: clear
  • docs/specs/AST-083-result-order/spec.md: non-blocking note (Intent)
  • eslint.config.js: clear
  • packages/cli/api/build/build.test.mjs: clear
  • packages/cli/api/build/kit/rank.mjs: clear
  • packages/cli/api/build/kit/rank.test.mjs: clear
  • packages/cli/api/component/list/list.mjs: clear
  • packages/cli/api/discover/search/search.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: clear
  • packages/cli/api/doctor/_adapter.mjs: clear
  • packages/cli/api/doctor/built-checks.mjs: clear
  • packages/cli/api/icon/_records.mjs: clear
  • packages/cli/api/integration/authoring-checks.mjs: clear
  • packages/cli/api/integration/validate-integration.mjs: clear
  • packages/cli/api/search/_lexical.mjs: clear
  • packages/cli/api/theme-edit/_preview-app.mjs: clear
  • packages/cli/api/theme-edit/_preview.mjs: clear
  • packages/cli/api/theme-edit/_settings.mjs: clear
  • packages/cli/api/theme/_adapter.mjs: clear
  • packages/cli/api/upgrade/run/run.mjs: clear
  • packages/cli/assets/codemods/integration-discovery.mjs: clear
  • packages/cli/clients/cli/commands/component.host-locale.test.mjs: clear
  • packages/cli/clients/cli/commands/component.mjs: clear
  • packages/cli/clients/cli/commands/doctor-integration.test.mjs: clear
  • packages/cli/clients/cli/lib/cli-error.mjs: clear
  • packages/cli/clients/cli/lib/manifest.mjs: clear
  • packages/cli/clients/cli/lib/manifest.test.mjs: clear
  • packages/cli/foundation/discovery/component-discovery.mjs: clear
  • packages/cli/foundation/discovery/component-discovery.test.mjs: clear
  • packages/cli/foundation/discovery/copied-passages.mjs: clear
  • packages/cli/foundation/discovery/doc-types.mjs: clear
  • packages/cli/foundation/discovery/hook-discovery.mjs: clear
  • packages/cli/foundation/discovery/hook-discovery.test.mjs: clear
  • packages/cli/foundation/discovery/icon-definition-discovery.mjs: clear
  • packages/cli/foundation/discovery/icon-set-checks.mjs: clear
  • packages/cli/foundation/discovery/icon-set-discovery.mjs: clear
  • packages/cli/foundation/discovery/integration-doc-files.mjs: clear
  • packages/cli/foundation/discovery/prop-drift.mjs: clear
  • packages/cli/foundation/discovery/template-adapter.mjs: clear
  • packages/cli/foundation/discovery/template-icons.mjs: clear
  • packages/cli/foundation/discovery/theme-discovery.mjs: clear
  • packages/cli/foundation/discovery/theming-targets.mjs: clear
  • packages/cli/foundation/discovery/theming-targets.test.mjs: clear
  • packages/cli/foundation/doc-compiler/inputs.mjs: clear
  • packages/cli/foundation/env/semver.mjs: clear
  • packages/cli/foundation/fs/file-protection.mjs: clear
  • packages/cli/foundation/integrations/contribution-inventory.mjs: clear
  • packages/cli/foundation/integrations/public-imports.mjs: clear
  • packages/cli/foundation/render/rebuild.mjs: clear
  • packages/cli/foundation/text/compare-text.mjs: non-blocking note (header wording)
  • packages/cli/foundation/text/compare-text.test.mjs: clear
  • packages/cli/foundation/text/string-utils.mjs: clear
  • packages/cli/foundation/text/string-utils.test.mjs: clear
  • packages/cli/foundation/text/suggest-order.mjs: clear
  • packages/cli/foundation/xle/expand.mjs: clear

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 43445a6 into main Nov 14, 2026
81 checks passed
@github-actions
github-actions Bot deleted the josephfarina/compare-text branch November 15, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — c946b351 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant